package edu.rice.cs.drjava.ui;


import javax.swing.JMenu;

	import junit.framework.TestCase;



	public class MainFrameAdditionTest extends TestCase {

		
	    public void testAdditiontext() {
	        
	        MainFrame _frame = new MainFrame();
	        boolean result = false;
	    
	              
	        JMenu menu = _frame.getProjectMenu();

	        /** iterating through all the items in Tools Menu */
	        for (int i = 0; i < menu.getMenuComponentCount(); i++) {
	            
	        	/** selecting only the JMenuItem objects */

	        	if ( menu.getMenuComponent(i).getClass().getName().equalsIgnoreCase("javax.swing.JMenu$1")  ) {
	            
	        		/** Searching for "Create Text Report" menu item and imitating a click on that item */
	                
	        		if (menu.getItem(i).getText().matches("Create Text Report")){
	                    result = true;
	                
	                }
	        	}
	        }
	        
	        assertTrue("Create Text Report function is available!", result);
	    }
	}
		


